<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="pragma" content="no-cach" /> 
<meta http-equiv="cache-control" content="no-cache" /> 
<meta http-equiv="expires" content="0" />
<title>无标题文档</title>
<style>
body{margin:0px;
}
.inp{ width:250px; 
        overflow:hidden;


}
#main{
	height:100%;
	width:100%;
	}
</style>
<script>
window.timenum=1;
window.onload=function(){
window.timer_fx= setInterval(function(){ch();_g('player').blur();},2000);	
}
function _high(ar){
  if(ar!=null){
      return "<span style='color:red;'><b>"+ar+"</b></span>";
  }else{
      return ar;	
  }
}
function ShowObjProperty(Obj) { 
    var PropertyList = ''; 
    for(i in Obj){ 
   //  if(Obj.i != null) {
      PropertyList = PropertyList +'['+ i + ']属性：' + Obj.i + '<br>\r\n'; 
   //  } else {
     PropertyList = PropertyList +'['+ i + '] 方法:'+_high(Obj.getAttribute(i))+'<br>\r\n';} 
	// }
	 return  PropertyList;
}
 


function _g(id){
return window.document.getElementById(id);
}
function sorh(){

	 if(_g("id1").style.display!="block"){
       // _g("id1").style.display="block";
	}else{
		// _g("id1").style.display="none";
	} 
}

function _bs(id){

	 if(_g(id).style.display!="block"){
         _g(id).style.display="block";
	}else{
		  _g(id).style.display="none";
	} 
}
function _gtag(tag){
	return  document.getElementsByTagName(tag);
}

function resets()
{
  var controls = document.getElementsByTagName('input');
  for(var i=0; i<controls.length; i++){
    if(controls[i].type=='button'){
     // controls[i].value='button';
	  //controls[i].v='fadsf';
	 //controls[i].setAttribute("v","vvvvv");
	// alert( controls[i].v);
    }
  }

}


function randplay()
{  window.timenum=1;
  var controls = document.getElementsByTagName('input');
  var $arr=new Array();
  var j=0;
  for(var i=0; i<controls.length; i++){
	  
    if(controls[i].type=='button'){
     $arr[j]=controls[i].value;
	 j++;
    }
  }
 
  if(isNaN(window._playid)||window._playid>=$arr.length-1){
	
	 $arr=_randarr($arr);
	 window._playid=0;
	 _g('playid').innerHTML="init:"+($arr.length-1)+"|"+window._playid;
	  
	  }else{
		window._playid=window._playid+1;  
		_g('playid').innerHTML=($arr.length-1)+"|"+window._playid;
	}
 var __src=$arr[window._playid]

 _g('player').src=__src;
  _g('player').play();
   
}

function _rand(max,min){
    return Math.round(  Math.random()*(max - min) + min  );
}
</script>
</head>

<body  style=" overflow:hidden;" onKeyDown="_kd();">
<div style="height:1px; background-color:#fff; width:100%; border:none; position: relative; float:right; clear:both;" id="idtop"></div>
<table width="100%" height="98%" border="0" cellspacing="0" cellpadding="0" style="margin:0px;" >

  <tr>
    <td >
 

<div style=" position: relative; display:block; width:300px; height:1000px; float:left; overflow-x: hidden;overflow-y:scroll;  "  id="id1">

<input name="" type="reset" value="BESTie - 恋爱的条件" onClick="_g('player').src='[DownMV.com]BESTie - 恋爱的条件_min.mp4';" class="inp">
<input name="" type="reset" value="ot" onClick="_g('player').src='1.mp4';resets();" class="inp">
<input name="" type="button" value="%23P_0019_[120229] T-ara - Roly Poly (日文版.) BS Japan-MADE IN BS JAPAN[60帧].mp4" onClick="_g('player').src='../../VPLIST/%23P_0019_[120229] T-ara - Roly Poly (日文版.) BS Japan-MADE IN BS JAPAN[60帧].mp4';"  class="inp"> 
 <input name="" type="reset" value="_bs(id)" onClick="_bs('info')" class="inp" style="float:left; width:80px; overflow:hidden; margin-right:10px;">
  <input name="" type="reset" value="_index.html" onClick="window.open('_index.html?a='+Math.random());" class="inp" style="float:left; width:80px; overflow:hidden;margin-right:10px;">
   <input name="" type="reset"  value="更新缓存" onClick="window.open('auto.php?do=do');" class="inp" style="float:left; width:80px; overflow:hidden;margin-right:10px;clear:right;">
     <input name="" type="reset"  value="randplay()" onClick="randplay();" class="inp" style="float:left; width:80px; overflow:hidden;margin-right:10px;clear:right;">
     <span id='playid'>playid</span><br>
  按pgUp全屏，按pgDn切换视频,可能只支持谷哥浏览器<br>
<?php
require_once('../inc.php');
echo date('Y-m-d h:i:s',time());
?>

<?php 
function _videoname($arr){
	$retarr=array();
	foreach($arr as $key => $val){
	//$str	=	preg_replace(        "/\.\.[\/\\\]{1,}/","",                           iconv('GB2312','UTF-8', $val)                 );
	$str              =   iconv('GB2312','UTF-8', $val)  ;
	$str              = preg_replace("/#/","%23",$str);
	 if(preg_match("/\.mp4/i",$str)!=0){
		 if(preg_match("/\.del\./i",$str)==0){
	    $retarr[$key] =   $str ;
		 }
	  }
	}
	return $retarr;
}
function _arr_fill_input($arr){
	$retarr=array();
	foreach($arr as $key => $val){
        $str="<input name='' type='button'  ";
       // $str=$str."value=\"".preg_replace( array("/\.\.[\/\\\]{1,}/","/VPLIST/"),"", $val)."\" onClick=\"_g('player').src='".$val."';_g('info').innerHTML=(this.value)\"  ";
	 $str=$str."value=\"".$val."\" onClick=\"_g('player').src='".$val."';_g('info').innerHTML=(this.value)\"  ";
        $str=$str."class='inp'     >" ;
		$retarr[$key]=$str;
	}	
	return $retarr;
}
$filenames= _videoname(  glob("../../VPLIST/*.mp4"))  ;
secho(_arr_fill_input($filenames));
?>
</div>
</td>
<td>
<div      id="info" style=" overflow-y: scroll; overflow-x: hidden; height:80px; display:none;">444</div>
<div style="width:100%; float: left; position:relative; margin-top:0px; margin-left:0px;">
<video  src="1.mp4" controls="controls" autoplay="autoplay"  width="100%" id="player" onKeyDown="_kd();" onclick="change_controls()" onDblClick="randplay();	"   style="ime-mode:disabled;"  >
your browser does not support the video tag
</video>
</div>
</center>

<script>
function change_controls(){
   if(_g('player').controls==false){
		_g('player').controls=true;
	}else{
	  //  _g('player').controls=false;
	}
}
function ch(){

    
    var str="duration:"+_g('player').duration+"|currentTime:"+_high(_g('player').currentTime)+"|ended:"+_g('player').ended;
	str=str+"<br>currentSrc:"+_g('player').currentSrc+'<br>';
	str=str+"playbackRate:"+_high(_g('player').playbackRate)+'<br>';
	str=str+_high(Math.abs(   _g('player').duration-_g('player').currentTime ));
	 _g('info').innerHTML=str+ShowObjProperty(_g('player')) ;
	 var num=Math.abs( _g('player').duration-_g('player').currentTime );
	//alert(NaN-200<200);
	     if(num<4 ){	 
		     if(window.timenum==1){
	             window.time_fx2=window.setTimeout(function(){ randplay();},4000);	
				 window.timenum=2;
			  }
		    }
			if(isNaN(num)){
			//alert("isNaN");	
			//deplaysrc()
			}
		if(_g('player').currentSrc=='undefined'){
			alert(800000)
			deplaysrc()
			
		}

}
function deplaysrc(){
	_g('player').src="1.mp4";
	_g('player').play();
}
window.setTimeout(function(){randplay();},2000);

function _randarr(arr){
    var arrax=new Array();
	var len=arr.length;
    for($i=0;$i<len;$i++){ 
        var ele=arr.splice(  _rand(arr.length-1,0) ,1    );
        arrax[$i]=ele[0];
    }
	return arrax;
}
function _kd(){
	//alert(event.keyCode);

	try{
	 if(event.keyCode==13||event.keyCode==34){
randplay();	
 _g('player').controls=null;
 _g('player').removeAttribute('controls');
	 }}catch(e){}
	 try{
	  if(event.keyCode==33){
		  
		  window._full=true;
		  if(_g('id1').style.width!='0px'){
		 _g('player').style.width='1920px';  
		   _g('id1').style.display='none';
		  _g('id1').style.width='0px';  
		  _g('idtop').style.backgroundColor='#000';
		  _g('id1').style.overflow='hidden';
		     var el = document.documentElement; 
            var rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen; 
            if (typeof rfs != "undefined" && rfs) { rfs.call(el); }
		  }else {
		 _g('player').style.width='100%';  
		 _g('id1').style.display='block';  
		 _g('id1').style.width='300px';
		 _g('idtop').style.backgroundColor='#fff';
		  _g('id1').style.overflowY='scroll';

		  // var el = document.documentElement; 
           //var rfs=el.exitFullscreen||el.mozCancelFullScreen||el.webkitExitFullscreen;
           //if (typeof rfs != "undefined" && rfs) { rfs.call(el); }
		 document.webkitExitFullscreen();
	     }
	   }
	 }catch(e){}
   
   
   
   
}

 
</script>
</td>
</table>
<iframe src="auto.php" style="display:none;  "></iframe>
</body>
</html>